﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Parser.ASN1Parser.Nodes;
using Core.Model;
using Core.Exceptions;

namespace Core.Parser.ASN1Parser.Builders
{
    internal class Builder
    {

        internal static Group Build(TaggedNode node)
        {
            Group ret;

            switch (node.Tag)
            {
                case ASN1ContextCodes.C_APPLICATION: 
                    
                    ret = ApplicationBuilder.Build(node);
                    break;
                
                case ASN1ContextCodes.C_SCENE:
                    ret = SceneBuilder.Build(node);
                    break;

                default:
                    throw new OpenMhegException("Expected Scene or Application");
            }

            
            return ret;

        }

    }
}
